<div>
    <div class="ibox">
        <div class="ibox-title">
            <h5>
                <vc:i18n name="添加车辆" namespace="hireParkingSpace"></vc:i18n>
            </h5>
            <div class="ibox-tools" style="top:10px;">
                <button type="button" class="btn btn-white btn-sm" v-on:click="_goBack()">
                    <i class="fa fa-close"></i>返回
                </button>
            </div>
        </div>
        <div class="ibox-content">
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-right">
                    <vc:i18n name="车牌号" namespace="hireParkingSpace"></vc:i18n>
                </label>
                <div class="col-sm-4">
                    <input v-model="hireParkingSpaceInfo.carNum" type="text"
                        :placeholder="vc.i18n('必填，请填写车牌号','hireParkingSpace')" class="form-control">
                </div>
                <label class="col-sm-2 col-form-label text-right">
                    <span>
                        <vc:i18n name="车类型" namespace="hireParkingSpace"></vc:i18n>
                    </span>
                </label>
                <div class="col-sm-4">
                    <select class="custom-select" v-model="hireParkingSpaceInfo.carType">
                        <option selected disabled value="">
                            {{vc.i18n('必填，请选择车辆类型','hireParkingSpace')}}
                        </option>
                        <option v-for="carType in hireParkingSpaceInfo.carTypes" :key="carType.statusCd"
                            v-bind:value="carType.statusCd">{{carType.name}}
                        </option>
                    </select>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-right">
                    <vc:i18n name="车牌类型" namespace="hireParkingSpace"></vc:i18n>
                </label>
                <div class="col-sm-4">
                    <select class="custom-select" v-model="hireParkingSpaceInfo.leaseType" @change="_changeLeaseType()">
                        <option selected disabled value="">{{vc.i18n('必填，请选择车牌类型','hireParkingSpace')}}</option>
                        <option value="H">{{vc.i18n('月租车','hireParkingSpace')}}</option>
                        <option value="S">{{vc.i18n('出售车辆','hireParkingSpace')}}</option>
                        <option value="I">{{vc.i18n('内部车','hireParkingSpace')}}</option>
                        <option value="NM">{{vc.i18n('免费车','hireParkingSpace')}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group row" v-show="hireParkingSpaceInfo.leaseType == 'H'">
                <label class="col-sm-2 col-form-label text-right">
                    <vc:i18n name="起租时间" namespace="hireParkingSpace"></vc:i18n>
                </label>
                <div class="col-sm-4">
                    <input v-model="hireParkingSpaceInfo.startTime" type="text"
                        :placeholder="vc.i18n('必填，请填写起租时间','hireParkingSpace')" class="form-control addStartTime">
                </div>
                <label class="col-sm-2 col-form-label text-right">
                    <vc:i18n name="结租时间" namespace="hireParkingSpace"></vc:i18n>
                </label>
                <div class="col-sm-4">
                    <input v-model="hireParkingSpaceInfo.endTime" type="text"
                        :placeholder="vc.i18n('必填，请填写结租时间','hireParkingSpace')" class="form-control addEndTime">
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-right">
                    <vc:i18n name="业主" namespace="hireParkingSpace"></vc:i18n>
                </label>
                <div class="col-sm-3">
                    <input v-model="hireParkingSpaceInfo.ownerName" disabled type="text"
                        :placeholder="vc.i18n('必填，请选择业主','hireParkingSpace')" class="form-control">
                </div>
                <div class="col-sm-1">
                    <button type="button" class="btn btn-primary btn-sm" v-on:click="_openChooseOwner()">选择业主
                    </button>
                    <a target="_blank" href="/#/pages/property/listOwner?tab=业主信息" class="margin-left-xs">添加</a>
                </div>
                <label class="col-sm-2 col-form-label text-right">
                    <span>
                        <vc:i18n name="车位" namespace="hireParkingSpace"></vc:i18n>
                    </span>
                </label>
                <div class="col-sm-3">
                    <input v-model="hireParkingSpaceInfo.psName" disabled type="text"
                        :placeholder="vc.i18n('必填，请选择车位','hireParkingSpace')" class="form-control">
                </div>
                <div class="col-sm-1">
                    <button type="button" class="btn btn-primary btn-sm" v-on:click="openSearchParkingSpaceModel()">选择车位
                    </button>
                    <a target="_blank" href="/#/pages/property/listParkingSpace?tab=车位信息" class="margin-left-xs">添加</a>
                </div>
            </div>
            <!-- dev - 属性管理 - 属性 - owner_car_attr -->
            <div v-for="(item,index) in hireParkingSpaceInfo.attrs">
                <div class="form-group row" v-if="item.specType == '2233'">
                    <label class="col-sm-2 col-form-label text-right">{{item.specName}}</label>
                    <div class="col-sm-4">
                        <input v-model="item.value" type="text" :placeholder="item.specHoldplace" class="form-control">
                    </div>
                </div>
                <div class="form-group row" v-if="item.specType == '3344'">
                    <label class="col-sm-2 col-form-label text-right">{{item.specName}}</label>
                    <div class="col-sm-4">
                        <select class="custom-select" v-model="item.value">
                            <option selected disabled value="">{{item.specHoldplace}}</option>
                            <option v-for="value in item.values" :label="value.valueName" :value="value.value">
                                {{item.valueName}}
                            </option>

                        </select>
                    </div>
                </div>
            </div>
            <div class="form-group row">
                <label class="col-sm-2 col-form-label text-right">
                    <vc:i18n name="备注" namespace="hireParkingSpace"></vc:i18n>
                </label>
                <div class="col-sm-4">
                    <textarea v-model="hireParkingSpaceInfo.remark"
                        :placeholder="vc.i18n('选填，请填写备注','hireParkingSpace')" class="form-control">
                                    </textarea>
                </div>


            </div>
            <div class="row">
                <div class="col-md-12 text-right">
                    <button type="button" class="btn btn-warning " style="margin-right:20px;" @click="_goBack()">
                        <vc:i18n name="返回" namespace="hireParkingSpace"></vc:i18n>
                    </button>
                    <button class="btn btn-primary" type="button" v-on:click="saveAddCarInfo()"><i
                            class="fa fa-check"></i>&nbsp;提交
                    </button>
                </div>
            </div>
            <vc:create path="property/searchOwner" emitChooseOwner="hireParkingSpace" emitLoadData="hireParkingSpace">
            </vc:create>
            <vc:create path="car/searchParkingSpace" emitChooseParkingSpace="hireParkingSpace"
                emitLoadData="hireParkingSpace" parkingSpaceFlag="F" showSearchCondition="true">
            </vc:create>
        </div>
    </div>
</div>